package com.wz.project.cxtj.cargoSpaceHistory.service.impl;

import com.wz.common.utils.DateUtils;
import com.wz.common.utils.text.Convert;
import com.wz.project.cxtj.cargoSpaceHistory.domain.ViewCargospaceHistory;
import com.wz.project.cxtj.cargoSpaceHistory.mapper.ViewCargospaceHistoryMapper;
import com.wz.project.cxtj.cargoSpaceHistory.service.IViewCargospaceHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 货位履历Service业务层处理
 * 
 * @author qxq
 * @date 2021-11-02
 */
@Service
public class ViewCargospaceHistoryServiceImpl implements IViewCargospaceHistoryService 
{
    @Autowired
    private ViewCargospaceHistoryMapper viewCargospaceHistoryMapper;

    /**
     * 查询货位履历
     * 
     * @param cargoSpaceName 货位履历ID
     * @return 货位履历
     */
    @Override
    public ViewCargospaceHistory selectViewCargospaceHistoryById(String cargoSpaceName)
    {
        return viewCargospaceHistoryMapper.selectViewCargospaceHistoryById(cargoSpaceName);
    }

    /**
     * 查询货位履历列表
     * 
     * @param viewCargospaceHistory 货位履历
     * @return 货位履历
     */
    @Override
    public List<ViewCargospaceHistory> selectViewCargospaceHistoryList(ViewCargospaceHistory viewCargospaceHistory)
    {
        return viewCargospaceHistoryMapper.selectViewCargospaceHistoryList(viewCargospaceHistory);
    }

    /**
     * 新增货位履历
     * 
     * @param viewCargospaceHistory 货位履历
     * @return 结果
     */
    @Override
    public int insertViewCargospaceHistory(ViewCargospaceHistory viewCargospaceHistory)
    {
        viewCargospaceHistory.setCreateTime(DateUtils.getNowDate());
        return viewCargospaceHistoryMapper.insertViewCargospaceHistory(viewCargospaceHistory);
    }

    /**
     * 修改货位履历
     * 
     * @param viewCargospaceHistory 货位履历
     * @return 结果
     */
    @Override
    public int updateViewCargospaceHistory(ViewCargospaceHistory viewCargospaceHistory)
    {
        return viewCargospaceHistoryMapper.updateViewCargospaceHistory(viewCargospaceHistory);
    }

    /**
     * 删除货位履历对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteViewCargospaceHistoryByIds(String ids)
    {
        return viewCargospaceHistoryMapper.deleteViewCargospaceHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除货位履历信息
     * 
     * @param cargoSpaceName 货位履历ID
     * @return 结果
     */
    @Override
    public int deleteViewCargospaceHistoryById(String cargoSpaceName)
    {
        return viewCargospaceHistoryMapper.deleteViewCargospaceHistoryById(cargoSpaceName);
    }
}
